.class public Lcom/zuiapps/suite/utils/db/SharePrefHelper;
.super Ljava/lang/Object;
.source "SharePrefHelper.java"


# static fields
.field private static sharePrefHelper:Lcom/zuiapps/suite/utils/db/SharePrefHelper;


# instance fields
.field private final PREFS_FILE:Ljava/lang/String;

.field private prefs:Landroid/content/SharedPreferences;


# direct methods
.method static constructor <clinit>()V
    .registers 1

    .prologue
    .line 16
    const/4 v0, 0x0

    sput-object v0, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->sharePrefHelper:Lcom/zuiapps/suite/utils/db/SharePrefHelper;

    return-void
.end method

.method protected constructor <init>(Landroid/content/Context;)V
    .registers 4
    .param p1, "cxt"    # Landroid/content/Context;

    .prologue
    .line 19
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 15
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->prefs:Landroid/content/SharedPreferences;

    .line 17
    const-string v0, "brixd.prefs"

    iput-object v0, p0, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->PREFS_FILE:Ljava/lang/String;

    .line 28
    const-string v0, "brixd.prefs"

    const/4 v1, 0x4

    invoke-virtual {p1, v0, v1}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;

    move-result-object v0

    iput-object v0, p0, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->prefs:Landroid/content/SharedPreferences;

    .line 29
    return-void
.end method

.method protected constructor <init>(Landroid/content/Context;Ljava/lang/String;)V
    .registers 4
    .param p1, "cxt"    # Landroid/content/Context;
    .param p2, "name"    # Ljava/lang/String;

    .prologue
    .line 31
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 15
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->prefs:Landroid/content/SharedPreferences;

    .line 17
    const-string v0, "brixd.prefs"

    iput-object v0, p0, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->PREFS_FILE:Ljava/lang/String;

    .line 32
    const/4 v0, 0x0

    invoke-virtual {p1, p2, v0}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;

    move-result-object v0

    iput-object v0, p0, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->prefs:Landroid/content/SharedPreferences;

    .line 33
    return-void
.end method

.method public static getInstance(Landroid/content/Context;)Lcom/zuiapps/suite/utils/db/SharePrefHelper;
    .registers 2
    .param p0, "context"    # Landroid/content/Context;

    .prologue
    .line 36
    sget-object v0, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->sharePrefHelper:Lcom/zuiapps/suite/utils/db/SharePrefHelper;

    if-nez v0, :cond_b

    .line 37
    new-instance v0, Lcom/zuiapps/suite/utils/db/SharePrefHelper;

    invoke-direct {v0, p0}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;-><init>(Landroid/content/Context;)V

    sput-object v0, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->sharePrefHelper:Lcom/zuiapps/suite/utils/db/SharePrefHelper;

    .line 39
    :cond_b
    sget-object v0, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->sharePrefHelper:Lcom/zuiapps/suite/utils/db/SharePrefHelper;

    return-object v0
.end method

.method public static newInstance(Landroid/content/Context;)Lcom/zuiapps/suite/utils/db/SharePrefHelper;
    .registers 2
    .param p0, "context"    # Landroid/content/Context;

    .prologue
    .line 43
    new-instance v0, Lcom/zuiapps/suite/utils/db/SharePrefHelper;

    invoke-direct {v0, p0}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;-><init>(Landroid/content/Context;)V

    sput-object v0, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->sharePrefHelper:Lcom/zuiapps/suite/utils/db/SharePrefHelper;

    .line 44
    sget-object v0, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->sharePrefHelper:Lcom/zuiapps/suite/utils/db/SharePrefHelper;

    return-object v0
.end method

.method public static newInstance(Landroid/content/Context;Ljava/lang/String;)Lcom/zuiapps/suite/utils/db/SharePrefHelper;
    .registers 3
    .param p0, "context"    # Landroid/content/Context;
    .param p1, "name"    # Ljava/lang/String;

    .prologue
    .line 54
    new-instance v0, Lcom/zuiapps/suite/utils/db/SharePrefHelper;

    invoke-direct {v0, p0, p1}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;-><init>(Landroid/content/Context;Ljava/lang/String;)V

    return-object v0
.end method


# virtual methods
.method public getPref(Ljava/lang/String;F)F
    .registers 4
    .param p1, "key"    # Ljava/lang/String;
    .param p2, "defaultValue"    # F

    .prologue
    .line 104
    iget-object v0, p0, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->prefs:Landroid/content/SharedPreferences;

    invoke-interface {v0, p1, p2}, Landroid/content/SharedPreferences;->getFloat(Ljava/lang/String;F)F

    move-result v0

    return v0
.end method

.method public getPref(Ljava/lang/String;I)I
    .registers 4
    .param p1, "key"    # Ljava/lang/String;
    .param p2, "defaultValue"    # I

    .prologue
    .line 96
    iget-object v0, p0, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->prefs:Landroid/content/SharedPreferences;

    invoke-interface {v0, p1, p2}, Landroid/content/SharedPreferences;->getInt(Ljava/lang/String;I)I

    move-result v0

    return v0
.end method

.method public getPref(Ljava/lang/String;J)J
    .registers 6
    .param p1, "key"    # Ljava/lang/String;
    .param p2, "defaultValue"    # J

    .prologue
    .line 100
    iget-object v0, p0, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->prefs:Landroid/content/SharedPreferences;

    invoke-interface {v0, p1, p2, p3}, Landroid/content/SharedPreferences;->getLong(Ljava/lang/String;J)J

    move-result-wide v0

    return-wide v0
.end method

.method public getPref(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    .registers 4
    .param p1, "key"    # Ljava/lang/String;
    .param p2, "defaultValue"    # Ljava/lang/String;

    .prologue
    .line 92
    iget-object v0, p0, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->prefs:Landroid/content/SharedPreferences;

    invoke-interface {v0, p1, p2}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public getPref(Ljava/lang/String;Ljava/lang/Boolean;)Z
    .registers 5
    .param p1, "key"    # Ljava/lang/String;
    .param p2, "defaultValue"    # Ljava/lang/Boolean;

    .prologue
    .line 88
    iget-object v0, p0, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->prefs:Landroid/content/SharedPreferences;

    invoke-virtual {p2}, Ljava/lang/Boolean;->booleanValue()Z

    move-result v1

    invoke-interface {v0, p1, v1}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z

    move-result v0

    return v0
.end method

.method public hasPrefWithKey(Ljava/lang/String;)Z
    .registers 3
    .param p1, "key"    # Ljava/lang/String;

    .prologue
    .line 108
    iget-object v0, p0, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->prefs:Landroid/content/SharedPreferences;

    invoke-interface {v0, p1}, Landroid/content/SharedPreferences;->contains(Ljava/lang/String;)Z

    move-result v0

    return v0
.end method

.method public removePref(Ljava/lang/String;)Z
    .registers 4
    .param p1, "key"    # Ljava/lang/String;

    .prologue
    .line 112
    iget-object v1, p0, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->prefs:Landroid/content/SharedPreferences;

    invoke-interface {v1}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    .line 113
    .local v0, "editor":Landroid/content/SharedPreferences$Editor;
    invoke-interface {v0, p1}, Landroid/content/SharedPreferences$Editor;->remove(Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;

    .line 114
    invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->commit()Z

    move-result v1

    return v1
.end method

.method public setPref(Ljava/lang/String;F)V
    .registers 5
    .param p1, "key"    # Ljava/lang/String;
    .param p2, "value"    # F

    .prologue
    .line 70
    iget-object v1, p0, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->prefs:Landroid/content/SharedPreferences;

    invoke-interface {v1}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    .line 71
    .local v0, "editor":Landroid/content/SharedPreferences$Editor;
    invoke-interface {v0, p1, p2}, Landroid/content/SharedPreferences$Editor;->putFloat(Ljava/lang/String;F)Landroid/content/SharedPreferences$Editor;

    .line 72
    invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->commit()Z

    .line 73
    return-void
.end method

.method public setPref(Ljava/lang/String;I)V
    .registers 5
    .param p1, "key"    # Ljava/lang/String;
    .param p2, "value"    # I

    .prologue
    .line 76
    iget-object v1, p0, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->prefs:Landroid/content/SharedPreferences;

    invoke-interface {v1}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    .line 77
    .local v0, "editor":Landroid/content/SharedPreferences$Editor;
    invoke-interface {v0, p1, p2}, Landroid/content/SharedPreferences$Editor;->putInt(Ljava/lang/String;I)Landroid/content/SharedPreferences$Editor;

    .line 78
    invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->commit()Z

    .line 79
    return-void
.end method

.method public setPref(Ljava/lang/String;J)V
    .registers 6
    .param p1, "key"    # Ljava/lang/String;
    .param p2, "value"    # J

    .prologue
    .line 82
    iget-object v1, p0, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->prefs:Landroid/content/SharedPreferences;

    invoke-interface {v1}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    .line 83
    .local v0, "editor":Landroid/content/SharedPreferences$Editor;
    invoke-interface {v0, p1, p2, p3}, Landroid/content/SharedPreferences$Editor;->putLong(Ljava/lang/String;J)Landroid/content/SharedPreferences$Editor;

    .line 84
    invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->commit()Z

    .line 85
    return-void
.end method

.method public setPref(Ljava/lang/String;Ljava/lang/String;)V
    .registers 5
    .param p1, "key"    # Ljava/lang/String;
    .param p2, "value"    # Ljava/lang/String;

    .prologue
    .line 64
    iget-object v1, p0, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->prefs:Landroid/content/SharedPreferences;

    invoke-interface {v1}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    .line 65
    .local v0, "editor":Landroid/content/SharedPreferences$Editor;
    invoke-interface {v0, p1, p2}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;

    .line 66
    invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->commit()Z

    .line 67
    return-void
.end method

.method public setPref(Ljava/lang/String;Z)V
    .registers 5
    .param p1, "key"    # Ljava/lang/String;
    .param p2, "value"    # Z

    .prologue
    .line 58
    iget-object v1, p0, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->prefs:Landroid/content/SharedPreferences;

    invoke-interface {v1}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    .line 59
    .local v0, "editor":Landroid/content/SharedPreferences$Editor;
    invoke-interface {v0, p1, p2}, Landroid/content/SharedPreferences$Editor;->putBoolean(Ljava/lang/String;Z)Landroid/content/SharedPreferences$Editor;

    .line 60
    invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->commit()Z

    .line 61
    return-void
.end method
